Skip to content

Add Clippit as an optional comparison engine#24

Open
JSv4 wants to merge 4 commits into
mainfrom
add-clippit-engine
Open

Add Clippit as an optional comparison engine#24
JSv4 wants to merge 4 commits into
mainfrom
add-clippit-engine

Conversation

@JSv4
Copy link
Copy Markdown
Owner

@JSv4 JSv4 commented May 30, 2026

Summary

Adds Clippit — an actively-maintained .NET 8 fork of Open-XML-PowerTools — as a fourth, optional comparison engine, following the same companion-package pattern already used for ooxmlpowertools and docxodus.

This supersedes #17. That PR was opened against the pre-monorepo single-package layout and replaced the OOXML engine with Clippit. This branch is cut fresh from main and instead adds Clippit alongside the existing engines, so nothing is removed and users opt in via an extra.

pip install python-redlines[clippit]
from python_redlines.engines import ClippitEngine
redline_bytes, stdout, stderr = ClippitEngine().run_redline("Author", original, modified)

Why Clippit?

  • Open-XML-PowerTools was archived ~5 years ago.
  • Clippit is actively maintained, published to NuGet (Clippit 3.0.1), and targets .NET 8.
  • Same WmlComparer API — a drop-in wrapper, so ClippitEngine reuses the legacy 4-positional-arg CLI and BaseEngine._build_command() unchanged, and emits the same Revisions found: N stdout.

Changes

  • New binary package packages/clippit (python-redlines-clippit): pyproject.toml, platform-tag hatch_build.py, README.md, package __init__.py, and _binaries/.gitkeep. Version is single-sourced from packages/core like the other binary packages.
  • New C# CLI under csproj-clippit/ (clippit.csproj referencing Clippit 3.0.1, Program.cs). Clippit comes from NuGet, so no git submodule is needed.
  • Core: ClippitEngine added to engines.py and exported from python_redlines; clippit extra added (and folded into all).
  • Tooling/CI: build_differ.py builds the Clippit engine; ci.yml and python-publish.yml build and ship the new wheel across all platforms.
  • Tests: tests/test_clippit_engine.py plus ClippitEngine added to the shared test_engine_contract.py parametrization.
  • Docs: root README.md, packages/core/README.md, and CLAUDE.md updated (three engines / four packages).

Testing

  • ✅ Python wiring verified locally: extras, ClippitEngine attributes/inheritance, __all__, and build_differ engine list.
  • ⚠️ The C# engine compilation and integration tests require the .NET 8 SDK (not available in my local env) — covered by CI, which builds the binary per-platform and runs the test suite.

🤖 Generated with Claude Code

Adds Clippit — an actively-maintained .NET 8 fork of Open-XML-PowerTools —
as a fourth, optional engine, following the same companion-package pattern
used for ooxmlpowertools and docxodus.

- New binary package `packages/clippit` (python-redlines-clippit), version
  single-sourced from core, with the standard platform-tag build hook.
- New C# CLI under `csproj-clippit/` referencing the Clippit 3.0.1 NuGet
  package; same WmlComparer API and 4-positional-arg CLI as ooxmlpowertools,
  so `ClippitEngine` reuses BaseEngine._build_command() unchanged.
- `ClippitEngine` added to engines.py and exported from python_redlines.
- `clippit` extra added to core (and `all`); build_differ, CI, and publish
  workflows build and ship the new wheel.
- Tests: clippit integration test + ClippitEngine added to the shared
  engine contract; docs (README, CLAUDE.md) updated.

Supersedes #17, which targeted the pre-monorepo layout and replaced (rather
than added) the OOXML engine.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@JSv4 JSv4 force-pushed the add-clippit-engine branch from 8fa6021 to 4aad946 Compare May 30, 2026 22:52
The project/assembly was named `clippit`, which NuGet treats as colliding
(case-insensitively) with the referenced `Clippit` package, producing
`NU1108: Cycle detected`. Rename the assembly to `clippit-redline` and point
BINARY_BASE_NAME / build_differ at it. Also gitignore the csproj-clippit
build output dirs (bin/, obj/).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@JSv4 JSv4 force-pushed the add-clippit-engine branch from 4aad946 to 5ca1e9f Compare May 30, 2026 22:54
JSv4 and others added 2 commits May 30, 2026 20:55
The clippit engine was added but the CI/publish workflow and engine-contract
test edits never landed in the original commit, so CI installed core/ooxml/
docxodus but not python-redlines-clippit -> ClippitEngine tests failed with
EngineNotInstalledError. Add the missing pieces:
- ci.yml: install -e packages/clippit; build its wheel in build-engine-wheels
- python-publish.yml: build/publish the clippit wheel
- test_engine_contract.py: include ClippitEngine in the shared contract

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
These README edits failed to land in the original commit alongside the
ci/publish/contract edits. Add Clippit to the engine list, install examples,
monorepo table, and stdout-format table.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant